package cn.bonoon.controllers.question;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.bonoon.core.plugins.QuestionService;
import cn.bonoon.entities.plugins.QuestionEntity;
import cn.bonoon.kernel.web.annotations.grid.GridStandardDefinition;
import cn.bonoon.kernel.web.controllers.AbstractGridController;

@Controller
@RequestMapping("/s/sys/ask")
public class AskController extends AbstractGridController<QuestionEntity, AskItem> {
	private final QuestionService service;

	@Autowired
	public AskController(QuestionService service) {
		super(service);
		this.service = service;
	}

	@Override
	protected Class<AskItem> itemClass() {
		return AskItem.class;
	}

	@Override
	@GridStandardDefinition(
			updateClass = AskEditor.class, 
			detailClass = AskDetail.class)
	protected QuestionService initLayoutGrid(LayoutGridRegister register) throws Exception {
//		OperateIdsHandler.delete(register, service);
//
//		DialogDetailHandler.button(register, service, AskDetail.class);
//		DialogUpdateHandler.button(register, service, AskEditor.class);
//		OperateIdHandler.delete(register, service);
		return service;
	}
}
